package org.nanotek.tika.job.reader;

import java.util.Queue;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nanotek.Base;
import org.nanotek.jobs.GenericReader;
import org.springframework.batch.item.NonTransientResourceException;
import org.springframework.batch.item.ParseException;
import org.springframework.batch.item.UnexpectedInputException;
//import com.ibatis.common.logging.LogFactory;
//import org.apache.log4j.Logger;

public class BaseReader extends GenericReader{

	protected String fileStr; 
	private  Log log = LogFactory.getLog(BaseReader.class);
	Queue<Base<?>> baseQueue; 
	
	public BaseReader() 
	{ 
	}

	public BaseReader(Queue<Base<?>> baseQueue) {
		super();
		this.baseQueue = baseQueue;
	}

	@Override
	public Base<?> read() throws Exception, UnexpectedInputException,
			ParseException, NonTransientResourceException {
		Base<?> base = baseQueue.poll();
		log.debug(base.toString());
		return base;
	}

	public Queue<Base<?>> getBaseQueue() {
		return baseQueue;
	}

	public void setBaseQueue(Queue<Base<?>> baseQueue) {
		this.baseQueue = baseQueue;
	}

	
	
}
